package org.gw.building.util;

import org.springframework.format.datetime.DateFormatter;

import java.text.ParseException;
import java.util.Date;
import java.util.Locale;

public class MillsecondsDateFormatter extends DateFormatter {
	@Override
	public Date parse(String text, Locale locale) throws ParseException {
		try {
			long parseLong = Long.parseLong(text);
			return new Date(parseLong);
		} catch (Exception e) {
		}
		return getDateFormat(locale).parse(text);
	}
}
